package com.wgt;


import java.math.BigInteger;

/**
 * Created by wgt on 2017/5/27.
 */

/**
 * java7以上switch支持String
 */
public class switchTest {

    public static void main(String[] args) {
        // int result = (int) (Math.random() * (9999 - 1000 + 1)) + 1000;
        // System.out.println(result);
        try {
            String key = "bbb";
            switch (key) {
                case "bbb":
                    System.out.println("success: " + key);
                    break;
                default:
                    break;
            }
        } catch (Exception e) {
            System.out.println("fail: " + e.getMessage());
        }

    }
}
